package com.es.commons.amqp.linstner;

import com.es.core.service.SMSService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 描述:
 * Old-AgeCareSystem-
 *
 * @author Derek
 * @create 2021-12-09 9:47
 */
@Component
@Slf4j
public class QueueListener {

    @Autowired
    private SMSService service;


    @RabbitListener(queues = "boot-queue")
    public void queueReceive(String msg){
        log.info("我接收到的消息是:{}",msg);
    }

    @RabbitListener(queues = "boot-exchange-queue-1")
    public void queueReceive1(String msg){
        log.info("我接收到的消息是:{}",msg);
    }


    @RabbitListener(queues = "boot-exchange-queue-2")
    public void queueReceive2(String msg){
        log.info("我接收到的消息是:{}",msg);
    }


   /* @RabbitListener(queues = "sms-queue")
    public void smsQueueReceive(String msg){
        service.sendSMS(msg);
        log.info("我要发送短信了内容是:{}",msg);
    }*/
}
